﻿@model List<SmartParking.Web.Models.ReservationListItemModel>

<table id="grdReservations" border="1" style="color:#333333;font-size:10px;width:535px;border-collapse:collapse;">
			<tr style="text-align: center">
				<th style="width:100px;">Parqueo</th>
                <th style="width:100px;">Zona</th>
                <th style="width:50px;"># Placa</th>
                <th style="width:55px;">Día</th>
                <th style="width:55px;">Entrada</th>
                <th style="width:55px;">Salida</th>
                <th style="width:50px;">Monto</th>
                <th style="width:55px;">Comisión</th>
                <th style="width:15px;">&nbsp;</th>
			</tr>
@{
    if (Model.Count == 0)
    {
            <tr style="text-align:center;">
				<td colspan="10" style="width:100%;text-align:center;">No hay reservaciones realizadas hasta el momento</td>
			</tr>
    }
    else
    {
        decimal total = 0, comission = 0, row = 0;
        foreach (var item in Model)
        {            
            var rowName = "row-" + row.ToString();
            <tr style="text-align:center;">
                <td>@item.ParkingName</td>
                <td>@item.ParkingZoneName</td>
                <td>@item.CarPlate</td>
                <td>@item.Date</td>
                <td>@item.ReservationStartHour</td>
                <td>@item.ReservationEndHour</td>
                <td>¢@item.Amount</td>
                <td>¢@item.Comission</td>
                <td id=@rowName><input type="image" id="cmdDelete" title="Eliminar" alt="Eliminar Reservación" style="height:10px;border-width:0px;" src="~/Content/images/trash.gif"/></td>                
            </tr>
            total += Convert.ToDecimal(item.Amount);
            comission += Convert.ToDecimal(item.Comission);
            row++;
        }
            <tr>
                <td colspan="6" style="border: none"></td>
                <td style="border: none">SubTotal:</td>
                <td style="border: none; text-align: right">¢@total</td>
                <td style="border: none;"></td>
            </tr>
            <tr>
                <td colspan="6" style="border: none"></td>
                <td style="border: none">Comisión:</td>
                <td style="border: none; text-align: right">¢@comission</td>
                <td style="border: none"></td>
            </tr>
        total = total + comission;
            <tr>
                <td colspan="6" style="border: none">
                    <div class="terms">
                        <input type="checkbox" id="chboxTerms"/>
                        <span>Acepto todos los </span><a href="@Url.Action("Terms")">términos y condiciones</a><span> del servicio <strong>SmartParking</strong></span>
                    </div>
                </td>
                <td style="border: none; font-size: 12px"><strong>Total:</strong></td>
                <td style="border: none; font-size: 12px; text-align: right"><strong>¢@total</strong></td>
                <td style="border: none"></td>
            </tr>            
    }
}
</table>
